package com.koi.userservice.controller;


import com.koi.mccommon.Result;
import com.koi.userservice.domain.po.User;
import com.koi.userservice.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户信息表 前端控制器
 * </p>
 *
 * @author koi
 * @since 2025-03-03
 */
@RestController
@Api(tags = "用户信息")
@Slf4j
@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService userService;

    //根据id查询用户
    @PostMapping("/getUser/{id}")
    @ApiOperation(value = "获取用户信息")
    public Result<User> getUser(@PathVariable Integer id){
        User use=userService.getById(id);
        log.info("查询用户信息"+use);
        return Result.success(use);
    }

}
